<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>&#39;Common service definitions&#39;</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51822 BLE SDK
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__ble__sdk__srv__common.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#groups">Modules</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">'Common service definitions'</div>  </div>
<div class="ingroups"><a class="el" href="group__ble__sdk__srv.html">Bluetooth Services</a></div></div>
<div class="contents">

<p>Constants, type definitions and functions that are common to all services.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__srv__report__ref__t.html">ble_srv_report_ref_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Value of a Report Reference descriptor.  <a href="structble__srv__report__ref__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__srv__utf8__str__t.html">ble_srv_utf8_str_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">UTF-8 string data type.  <a href="structble__srv__utf8__str__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__srv__security__mode__t.html">ble_srv_security_mode_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Security settings structure.  <a href="structble__srv__security__mode__t.html#details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structble__srv__cccd__security__mode__t.html">ble_srv_cccd_security_mode_t</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Security settings structure.  <a href="structble__srv__cccd__security__mode__t.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="groups"></a>
Modules</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___u_u_i_d___s_e_r_v_i_c_e_s.html">Service UUID definitions</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___u_u_i_d___c_h_a_r_a_c_t_e_r_i_s_t_i_c_s.html">Characteristic UUID definitions</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___c_c_c_d___b_i_t_s.html">CCCD bit definitions</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___a_l_e_r_t___l_e_v_e_l___v_a_l_u_e_s.html">Definitions for the Alert Level characteristic values</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__common.html#gafbfc0ef111ca725cc8bb500fd93301cc">BLE_SRV_ENCODED_REPORT_REF_LEN</a>&#160;&#160;&#160;2</td></tr>
<tr><td colspan="2"><h2><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gac10076d39c0ddcfe333252fe8810a1f1"></a><!-- doxytag: member="ble_sdk_srv_common::ble_srv_error_handler_t" ref="gac10076d39c0ddcfe333252fe8810a1f1" args=")(uint32_t nrf_error)" -->
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__common.html#gac10076d39c0ddcfe333252fe8810a1f1">ble_srv_error_handler_t</a> )(uint32_t nrf_error)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Type definition for error handler function which will be called in case of an error in a service or a service library module. <br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static __INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__common.html#ga11fd3cc1b15d4bec4accc37618305ccb">ble_srv_is_notification_enabled</a> (uint8_t *p_encoded_data)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Inline function for decoding a CCCD value, and then testing if notification is enabled.  <a href="#ga11fd3cc1b15d4bec4accc37618305ccb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static __INLINE bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__common.html#gaf572afefe05bacfb4d5967d9c5a6c5e6">ble_srv_is_indication_enabled</a> (uint8_t *p_encoded_data)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Inline function for decoding a CCCD value, and then testing if indication is enabled.  <a href="#gaf572afefe05bacfb4d5967d9c5a6c5e6"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__common.html#gaebc3fc5316f1a6a67e830516b8f9aed5">ble_srv_report_ref_encode</a> (uint8_t *p_encoded_buffer, const <a class="el" href="structble__srv__report__ref__t.html">ble_srv_report_ref_t</a> *p_report_ref)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode a Report Reference Descriptor.  <a href="#gaebc3fc5316f1a6a67e830516b8f9aed5"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__ble__sdk__srv__common.html#ga611dfcf7209a57c2e45964e8bb4c5756">ble_srv_ascii_to_utf8</a> (<a class="el" href="structble__srv__utf8__str__t.html">ble_srv_utf8_str_t</a> *p_utf8, char *p_ascii)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Make UTF-8 structure refer to an ASCII string.  <a href="#ga611dfcf7209a57c2e45964e8bb4c5756"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>Constants, type definitions and functions that are common to all services. </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gafbfc0ef111ca725cc8bb500fd93301cc"></a><!-- doxytag: member="ble_srv_common.h::BLE_SRV_ENCODED_REPORT_REF_LEN" ref="gafbfc0ef111ca725cc8bb500fd93301cc" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BLE_SRV_ENCODED_REPORT_REF_LEN&#160;&#160;&#160;2</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The length of an encoded Report Reference Descriptor. </p>

<p>Definition at line <a class="el" href="ble__srv__common_8h_source.html#l00137">137</a> of file <a class="el" href="ble__srv__common_8h_source.html">ble_srv_common.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga11fd3cc1b15d4bec4accc37618305ccb"></a><!-- doxytag: member="ble_srv_common.h::ble_srv_is_notification_enabled" ref="ga11fd3cc1b15d4bec4accc37618305ccb" args="(uint8_t *p_encoded_data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static __INLINE bool ble_srv_is_notification_enabled </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_encoded_data</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Inline function for decoding a CCCD value, and then testing if notification is enabled. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_encoded_data</td><td>Buffer where the encoded CCCD is stored. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if notification is enabled, FALSE otherwise. </dd></dl>

<p>Definition at line <a class="el" href="ble__srv__common_8h_source.html#l00191">191</a> of file <a class="el" href="ble__srv__common_8h_source.html">ble_srv_common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf572afefe05bacfb4d5967d9c5a6c5e6"></a><!-- doxytag: member="ble_srv_common.h::ble_srv_is_indication_enabled" ref="gaf572afefe05bacfb4d5967d9c5a6c5e6" args="(uint8_t *p_encoded_data)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static __INLINE bool ble_srv_is_indication_enabled </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_encoded_data</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Inline function for decoding a CCCD value, and then testing if indication is enabled. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_encoded_data</td><td>Buffer where the encoded CCCD is stored. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if indication is enabled, FALSE otherwise. </dd></dl>

<p>Definition at line <a class="el" href="ble__srv__common_8h_source.html#l00203">203</a> of file <a class="el" href="ble__srv__common_8h_source.html">ble_srv_common.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaebc3fc5316f1a6a67e830516b8f9aed5"></a><!-- doxytag: member="ble_srv_common.h::ble_srv_report_ref_encode" ref="gaebc3fc5316f1a6a67e830516b8f9aed5" args="(uint8_t *p_encoded_buffer, const ble_srv_report_ref_t *p_report_ref)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t ble_srv_report_ref_encode </td>
          <td>(</td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_encoded_buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structble__srv__report__ref__t.html">ble_srv_report_ref_t</a> *&#160;</td>
          <td class="paramname"><em>p_report_ref</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encode a Report Reference Descriptor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_encoded_buffer</td><td>The buffer of the encoded data. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_report_ref</td><td>Report Reference value to be encoded. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Length of the encoded data. </dd></dl>

<p>Definition at line <a class="el" href="ble__srv__common_8c_source.html#l00020">20</a> of file <a class="el" href="ble__srv__common_8c_source.html">ble_srv_common.c</a>.</p>

</div>
</div>
<a class="anchor" id="ga611dfcf7209a57c2e45964e8bb4c5756"></a><!-- doxytag: member="ble_srv_common.h::ble_srv_ascii_to_utf8" ref="ga611dfcf7209a57c2e45964e8bb4c5756" args="(ble_srv_utf8_str_t *p_utf8, char *p_ascii)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ble_srv_ascii_to_utf8 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structble__srv__utf8__str__t.html">ble_srv_utf8_str_t</a> *&#160;</td>
          <td class="paramname"><em>p_utf8</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>p_ascii</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Make UTF-8 structure refer to an ASCII string. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">p_utf8</td><td>UTF-8 structure to be set. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_ascii</td><td>ASCII string to be referred to. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="ble__srv__common_8c_source.html#l00033">33</a> of file <a class="el" href="ble__srv__common_8c_source.html">ble_srv_common.c</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
